from starlette.applications import Starlette
import core.enterprise_authorize
import core.enterprise_agent
import core.public_authorize
import core.public_agent
import request_method as methods

control = Starlette()

control.add_route("/ent", core.enterprise_agent.CoreRoute, methods=methods.common)
control.add_route("/ent/jsapi/config", core.enterprise_authorize.JsApiConfig, methods=methods.post)
control.add_route("/ent/oauth/url", core.enterprise_authorize.OAuthURL, methods=methods.get)
control.add_route("/ent/oauth/fetch/user/id", core.enterprise_authorize.OAuthUserID, methods=methods.get)
control.add_route("/ent/fetch/user", core.enterprise_authorize.UserInfo, methods=methods.get)
control.add_route("/ent/refresh/token", core.enterprise_authorize.RefreshToken, methods=methods.get)

control.add_route("/pub", core.public_agent.PublicCoreRoute, methods=methods.common)
control.add_route("/pub/jsapi/config", core.public_authorize.JsApiConfig, methods=methods.post)
control.add_route("/pub/oauth/url", core.public_authorize.OAuthURL, methods=methods.get)
control.add_route("/pub/exchange/token", core.public_authorize.ExchangeAccessToken, methods=methods.get)
control.add_route("/pub/debug/user", core.public_authorize.PrepareUserForLocalDebug, methods=methods.get)
